package analysis;

import java.util.LinkedList;
import java.util.List;

import base.internal.ConcurrentMergeSort;
import base.internal.SeqMergeSort;


public class Analysis {

	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		List<String> s = new LinkedList<String>();
		s.add("amor");
		for(int i = 0; i < 500; i++){
			s.add(s.get(s.size()-1) + " " + System.currentTimeMillis());
		}
		
		for(int i = 0; i < 10; i++) {
			// start time
			long startTimeC = System.currentTimeMillis();
			// end time
			new ConcurrentMergeSort().sort(s, " ");
			long endTimeC = System.currentTimeMillis();
			float timeC = (endTimeC - startTimeC) / 1000.0f;
			
			long startTimeS = System.currentTimeMillis();
			// end time
			new SeqMergeSort().sort(s, " ");
			long endTimeS = System.currentTimeMillis();
			float timeS = (endTimeS - startTimeS) / 1000.0f;
			System.out.println("computation time: " + (timeC - timeS));
		
		}
	}

}
